package com.woniuxy.config;

import com.woniuxy.utils.FilterRegiter2;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: ideaAdmin
 * TODO:
 * Date: 2022/2/15:12:02
 * Description:
 */
@Configuration
public class FilterRegisterConfig {

    @Bean
    public FilterRegistrationBean<FilterRegiter2> filterRegister2() {
        FilterRegistrationBean<FilterRegiter2> filters = new FilterRegistrationBean<>();

        //加入到过滤器中
        filters.setFilter(new FilterRegiter2());

        //设置需要过滤的请求
        filters.addUrlPatterns("/*","/rbacmanager");

        //设置当前过滤器的优先级
        filters.setOrder(0);

        return filters;
    }


}
